import sys
import onnx
import os
import argparse
import numpy as np
import cv2
import onnxruntime

from tool.utils import *
from tool.darknet2onnx import *


def convert(cfg_file,  weight_file):

    onnx_path_demo = transform_to_onnx(cfg_file, weight_file, 1)

if __name__ == '__main__':
    print("Converting to onnx ...")
    if len(sys.argv) == 3:
        cfg_file = sys.argv[1]
        weight_file = sys.argv[2]
        convert(cfg_file, weight_file)
    else:
        print('Please run this way:\n')
        print('  python darnet_2_onnx <cfgFile>  <weightFile> ')
